import request from '@/utils/request'

// 设置项详情(废弃)
export const data = () => {
  return request.get('/setting/data')
}

// 获取可用物流渠道配置列表
export const logisticsChannels = (param, option) => {
  return request.get('/store/setting/enable-logistics-channels', param, option)
}

// 更新店铺订单设置
export const updateStoresConfigs = (param, option) => {
  return request.put('/store/setting/stores/order-configs', param, option)
}

// 更新门店的拣货配置
export const updateShopsPick = (param, option) => {
  return request.put('/store/setting/shops/pick', param, option)
}

// 更新门店订单渠道设置
export const updateShopsConfigs = (param, option) => {
  return request.put('/store/setting/shops/order-configs', param, option)
}

// 获取指定店铺订单设置
export const getStoresOrderConfig = (storeId, option) => {
  return request.get(`/store/setting/stores/${storeId}/order-config`, {}, option)
}

// 获取指定门店的拣货模式
export const getShopsPick = (shopId, option) => {
  return request.get(`/store/setting/shops/${shopId}/pick`, {}, option)
}

// 获取指定门店的拣货配置
export const getShopsPickConfig = (shopId, option) => {
  return request.get(`/store/setting/shops/${shopId}/pick-config`, {}, { load: false })
}

// 查询指定门店订单渠道设置列表
export const getShopsOrderConfig = (shopId, option) => {
  return request.get(`/store/setting/shops/${shopId}/order-configs`, {}, option)
}

// 获取渠道
export const getChannelList = () => {
  return request.get('/store/setting/channels', {}, { load: false })
}

